#include "agencymgr.h"
#include "cache.h"



AgencyMgr::AgencyMgr()
{
}
AgencyMgr::~AgencyMgr()
{
}

bool AgencyMgr::Update(stAgency&& agency)
{
    if (agency.name.empty()) 
    {
        return false;
    }
    m_mgr[agency.name] = std::move(agency);
    return true;
}
bool AgencyMgr::Update(const stAgency& agency)
{
    if (agency.name.empty()) 
    {
        return false;
    }
    m_mgr[agency.name] = agency;
    return true;
}
stAgency* AgencyMgr::Get(const std::string& name)
{
    auto it = m_mgr.find(name);
    if (it == m_mgr.end())
    {
        return nullptr;
    }
    return &it->second;
}









